<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
</html>
<script !src="">
    var str="OK了老铁"
    str = str + "!"
    console.log(str)
    str = str.concat("奥利给!")
    console.log(str)
    var v= str.indexOf("了")
    console.log(v)
    var v1=str.lastIndexOf("!")
    console.log(v1)
    var v2=str.indexOf("!")
    console.log(v2)
    var v3=str.charAt(3)
    console.log(v3)
    var v4=str.length
    console.log(v4)
    for (let i = 0; i <v4 ; i++) {
        console.log(str.charAt(i))
    }
    var v5=str.substring(5,7)
    console.log(v5)
    console.log("----------------------------")
    //替换
    var th=say1.replace("大","小")//替换首次出现
    var say4="我是一只小小小小鸟"
    var th2=say4.replaceAll("小","大")//替换所有
    //转换
    //字符串变数字
    var num=parseInt("25")
    var num2=parseFloat("3.14")
    console.log(num)
    console.log(num2)
    //数字转字符串
    var num3=45;
    var str=num3.toString();
    var str1=num3+""
    console.log(str)
    console.log(str1)
    console.log("-------------------")
    //集合转换
    //字符串转数组
    var ips="192.168.11.90"
    //分割
    var iparr=ips.split(".")
    console.log(iparr)
    //字符串转JSON
    //数组转字符串

</script>